using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Sailfish
{

    /// <summary>
    /// 忽视布局特性
    /// </summary>
    [System.AttributeUsage(AttributeTargets.Field)]
    public class JsonNotLayoutAttribute : JsonLayoutAttribute
    {
        public JsonNotLayoutAttribute()
        {
            layoutType = typeof(JsonValueNotShow);
        }
    }


    /// <summary>
    /// 布局字段特性
    /// </summary>
    [System.AttributeUsage(AttributeTargets.Class)]
    public class JsonFieldAttribute : Attribute
    {

    }


    /// <summary>
    /// 字段特性
    /// </summary>
    [System.AttributeUsage(AttributeTargets.Field)]
    public class JsonFieldTitleAttribute : Attribute
    {
        internal virtual void ShowGUI() { }
    }



    /// <summary>
    /// 布局类型特性
    /// </summary>
    [System.AttributeUsage(AttributeTargets.Field)]
    public class JsonLayoutAttribute : Attribute
    {
        public Type layoutType;
    }



    /// <summary>
    /// 字段特性
    /// </summary>
    public class JsonHeaderAttribute : JsonFieldTitleAttribute
    {
        public readonly string header;

        public JsonHeaderAttribute(string header)
        {
            this.header = header;
        }

        internal override void ShowGUI()
        {
            GUILayout.Label($"[{this.header}]");
        }
    }


}